package com.zmzncs.lmtc.module.customer.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zmzncs.lmtc.module.customer.pojo.cust_ticket.CustTicket;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zmzncs.lmtc.module.customer.pojo.cust_ticket.CustTicketDTO;
import com.zmzncs.lmtc.module.customer.pojo.cust_ticket.CustTicketShopSelectForm;
import com.zmzncs.lmtc.module.customer.pojo.customer.CustomerDTO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author 任建波
 * @since 2020-10-13
 */
@Repository
public interface CustTicketDao extends BaseMapper<CustTicket> {

    /**条件分页查询优惠券使用详情*/
    IPage<CustTicketDTO> getTicketUseInfo(Page page, @Param("ticketId") Long ticketId);

    /**根据券Id统计总领取和总使用数量*/
    CustTicketDTO sumTicketInfo(@Param("ticketId") Long ticketId);

    /**更新用户优惠券是否提示状态 */
    int updateOneTipsStatus(@Param("customerId")Long customerId);

    /**更新用户优惠券是否提示状态 */
    int updateMoreTipsStatus(@Param("custList")List<CustomerDTO> custList);

    /**分页查询商户优惠券领取情况*/
    IPage<CustTicketDTO> getShopTicketPage(Page page,@Param("form") CustTicketShopSelectForm form);
}
